package com.spzx.product.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.BaseEntity;

import java.io.Serial;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

/**
 * <p>
 * 商品sku库存表
 * </p>
 *
 * @author Haoran Sun
 * @since 2024-07-15
 */
@Getter
@Setter
@TableName("sku_stock")
@Schema(description = "商品sku库存表")
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class SkuStock extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品ID")
    @TableField("sku_id")
    private Long skuId;

    @Schema(description = "总库存数")
    @TableField("total_num")
    private Integer totalNum;

    @Schema(description = "锁定库存")
    @TableField("lock_num")
    private Integer lockNum;

    @Schema(description = "可用库存")
    @TableField("available_num")
    private Integer availableNum;

    @Schema(description = "销量")
    @TableField("sale_num")
    private Integer saleNum;

    @Schema(description = "线上状态：0-初始值，1-上架，-1-自主下架")
    @TableField("status")
    private Byte status;
}
